<?php
// +----------------------------------------------------------------------
// | Author: yaoyihong <510974211@qq.com>
// +----------------------------------------------------------------------

namespace app\api\controller;
use \tpfcore\Core;
/**
 * @title   用户接口
 * @description
 * @group   微信公众号接口
 * Class ProgramUser
 * @package app\api\controller
 */
class User extends ApiBase
{
	public function login(){
		$this->jump(Core::loadModel($this->name)->login($this->param));
	}
	public function wx_login(){
		$this->jump(Core::loadModel($this->name)->wx_login($this->param));
	}
	public function getToken(){
		$this->jump(Core::loadModel($this->name)->getToken($this->param));
	}
	/**
     * @title       微信公众号获取用户信息
     * @description 获取用户信息接口
     * @author      TPFrame
     * @url         /api/user/getUserInfo/
     * @method POST
     * @param_send  name:api_version type:string require:1 default:"1.0.0" other:格式x.x.x desc:版本号
     */
	public function getUserInfo(){
		$this->jump(Core::loadModel($this->name)->getUserInfo($this->param));
	}
	public function updateUserInfo(){
		$this->jump(Core::loadModel($this->name)->updateUserInfo($this->param));	
	}
	public function getRecommender(){
		$this->jump(Core::loadModel($this->name)->getRecommender($this->param));
	}
	public function getAccountLog(){
		$this->jump(Core::loadModel("AccountLog")->getAccountLog($this->param));
	}
	//提现记录
	public function getCashOutLog(){
		$this->jump(Core::loadModel("CashOutLog")->getCashOutLog($this->param));
	}
	public function addCashOutLog(){
		$this->jump(Core::loadModel("CashOutLog")->addCashOutLog($this->param));	
	}
	// 获取数据
	public function getStatistics(){
		$this->jump(Core::loadModel($this->name)->getUserStatistics());
	}
	//查询地址信息
	public function getAddress(){
		$this->jump(Core::loadModel("UserAddress")->getAddress($this->param));
	}
	//编辑地址信息
	public function editAddress(){
		$this->jump(Core::loadModel("UserAddress")->editAddress($this->param));
	}
	//删除地址
	public function deleteAddress(){
		$this->jump(Core::loadModel("UserAddress")->deleteAddress($this->param));	
	}
	//设置默认地址
	public function setDefaultAddress(){
		$this->jump(Core::loadModel("UserAddress")->setDefaultAddress($this->param));
	}
	// 验证支付密码
	public function checkPayPassword(){
		$this->jump(Core::loadModel($this->name)->checkPayPassword($this->param));	
	}
}